package org.example.Day1;

public class Test {
    public static void main(String[] args){
        Teacher t = new Teacher();
        test(t);
        Student s = new Student();
        test(s);
    }
    public static void test(People p){
        System.out.println("运行开始");
        p.run();
        System.out.println("结束");

        if(p instanceof Teacher){
            ((Teacher) p).drink();
        }
        if(p instanceof Student){
            ((Student) p).play();
        }
    }
}
